const { src, dest } = require('gulp')
const loadPlugins = require('gulp-load-plugins')
const plugins = loadPlugins()

const browserSync = require('browser-sync')
const bs = browserSync.create()

// 将scss转换为css
module.exports = style = () => {
    return src('src/assets/styles/*.scss', { base: 'src' })
        .pipe(plugins.sass({ outputStyle: 'expanded' })) // 将编译后的css展开
        .pipe(dest('temp'))
        .pipe(bs.reload({ stream: true }))
}